<?
// index.php
// ben@benmcgee.com
// 2008-02-01
// part of the UnderWARE schema
// Copyright 2008 Ben McGee
// available under the terms of The GNU General Public License Version 3

include "connect.php";
include "dbLogin.php";
include "header.php";
?>

<form>
<table width="75%" align=center>
<tr>
    <th colspan=6 align=center>
    <? 
    echo "$username's Tasks";
    ?>
    </th>
</tr>
<tr><td colspan=6 align=center>
<a href=newProject.php>New Project</a>&nbsp;|&nbsp;
<a href=newTask.php>New Task</a>&nbsp;|&nbsp;
<a href=logout.php>Logout</a>
</td></tr>
<tr>
    <td>Project</td>
    <td>Task</td>
    <td>Time</td>
</tr>

<?
$sql = "select * from task where userid = $userid";
$tasks = mysql_query("$sql") or die($sql . ";  " . mysql_error());

while($row = mysql_fetch_array($tasks)){
    echo "<tr><td>{$row['project']} </td>";
    echo "<td> {$row['description']} </td>";
    echo "<td align=right> {$row['total']} </td>";
    echo "<td align=right><input type=button value=Edit name=edit{$row['id']}></td>";
    echo "<td align=right><input type=button value=Delete name=del{$row['id']}></td>";
    echo "<td align=right><input type=button value=Go/Stop name=go{$row['id']}></td></tr>";
}
?>

</table>
</form>

<?
include "footer.php";
?>

